package com.fyh.feign;

import com.fyh.entity.common.Result;
import com.fyh.entity.job.JobPositionRequest;
import com.fyh.entity.job.SimpleJobPosition;
import com.fyh.entity.user.JobFavorite;
import com.fyh.feign.fallback.CandidateJobFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "service-job", fallback = CandidateJobFeignClientFallback.class, path = "/job")
public interface CandidateJobFeignClient {

    /**
     * 获取职位投递状态
     */
    @GetMapping("/getDeliveryExist")
    Result<Boolean> getDeliveryExist(@RequestParam("positionId") Long positionId, @RequestHeader("userId") Long userId);

    /**
     * 简历投递
     */
    @PutMapping("/deliveryVitae")
    Result deliveryVitae(@RequestParam("positionId") Long positionId, @RequestHeader("userId") Long userId);

    /**
     * 获取收藏职位基础信息列表
     */
    @PostMapping("/getSimpleJobListByPositionId")
    Result<List<SimpleJobPosition>> getSimpleJobListByPositionId(@RequestBody List<JobFavorite> jobFavoriteList);

    /**
     * 获取职位发布者id
     *
     * @param positionId
     * @return
     */
    @GetMapping("/getEmployerIdByPositionId")
    Result<Long> getEmployerIdByPositionId(@RequestParam("positionId") Long positionId);
}
